import request from '../utils/request'

// 获取用户个人信息
const getUserInfoAPI = () => {
  return request({
    url: '/v1_0/user'
  })
}

// 获取用户个人基本资料
const getUserProfileAPI = () => {
  return request({
    method: 'GET',
    url: '/v1_0/user/profile'
  })
}
// 更新用户头像
const updateUserPhotoAPI = ({ form }) => {
  return request({
    method: 'PATCH',
    url: '/v1_0/user/photo',
    data: form
  })
}

const updateUserProfilerAPI = ({ name, birthday }) => {
  return request({
    method: 'PATCH',
    url: '/v1_0/user/profile',
    data: {
      name,
      birthday
    }
  })
}
export {
  getUserInfoAPI,
  getUserProfileAPI,
  updateUserPhotoAPI,
  updateUserProfilerAPI
}
